home *** CD-ROM | disk | FTP | other *** search
/ Flash MX Savvy / FlashMX Savvy.iso / pc / MAC / Amapi3D / Amapi3DTrial_Edition / 3SPACE / ShowBehavior.js < prev    next >
Encoding:
Text File  |  2001-02-27  |  863 b   |  47 lines  |  [AMAS/AMAP]

  1. // -* ShowBehavior.js *-
  2. //
  3. // Name: Show behavior
  4. // Description: 
  5. // Author:
  6. // Version: $Id: ShowBehavior.js,v 1.3 2001/02/27 11:43:00 consumer Exp $
  7. //
  8.  
  9. function ShowBehavior()
  10. {
  11.   // No need for an object with this behavior.
  12. }
  13.  
  14. function ShowBehaviorStart(solidName, geom)
  15. {
  16.   // Member variables of the behavior
  17.   this.solidName = solidName;
  18.   this.geom = geom;
  19.   
  20.   TSUpdateNodeAttribute(geom, 'visible', '1');
  21. }
  22.  
  23. function ShowBehaviorStop()
  24. {
  25.   TSUpdateNodeAttribute(this.geom, 'visible', '0');
  26. }
  27.  
  28. //
  29. // Event functions
  30. //
  31.  
  32. function ShowBehaviorStartEvent(obj, event)
  33. {
  34.   var geom = TSGetExtraParam(event, 'geom');
  35.   var targetSolid = TSGetExtraParam(event, 'targetSolid');
  36.  
  37.   if (targetSolid == "")
  38.     ShowBehaviorStart(obj, geom);
  39.   else
  40.     ShowBehaviorStart(targetSolid, geom);
  41. }
  42.  
  43. function ShowBehaviorStopEvent(obj, event)
  44. {
  45.   ShowBehaviorStop() ;
  46. }
  47.